const {
  get,
  post,
  pureGet,
  upload,
  Delete,
  Put
} = require("./../utils/http");
const {
  contactUrlParams
} = require("./../utils/util");
//学校列表
const schoolList = param => {
  const query = contactUrlParams(param)
  return get(`api/school/page${query}`);
}
// 学校分校
const schoolBranch = param => {
  const query = contactUrlParams(param)
  return get(`api/school/branch/page${query}`);
}
// 分校详情
const schoolBranchDetail = id => {
  return get(`api/school/branch/${id}`)
}
// 学校详情-招生信息
const schoolNewsPage = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/news/page${query}`)
}
//学校详情-招生详情
const schoolNews = id => {
  return get(`api/school/news/${id}`)
}
const schoolDetail = id => {
  return get(`api/school/${id}`)
}
// 学校-招生计划 筛选条件-批次
const planBatch = (param,type) => {
  const {
    provinceId,
    schoolId
  } = param
  return get(`api/${type?type+'/':''}school/plan/batch/${provinceId}/${schoolId}`)
}
// 招生计划 已选专业
const voluntaryTtem = param => {
  const {
    tempId,schoolId
  } = param
  return get(`api/voluntary/template/item/${tempId}/${schoolId}`)
}

// 学校-招生计划 筛选条件-类别
const planCategory =  (param,type) => {
  const {
    provinceId,
    schoolId
  } = param
  return get(`api/${type?type+'/':''}school/plan/category/${provinceId}/${schoolId}`)
}
// 学校-招生计划 筛选条件-专业组
const planSpcgroup = (param,types) => {
  const {
    provinceId,
    schoolId,
    type
  } = param
  return get(`api/${types?types+'/':''}school/plan/spcgroup/${provinceId}/${schoolId}/${type}`)
}
// 学校-招生计划-列表分页
const planPage = (pram,type) => {
  const query = contactUrlParams(pram)
  return get(`api/${type?type+'/':''}school/plan/page${query}`)
}
// 往年招生计划
const planHistory = (pram) => {
  const query = contactUrlParams(pram)
  return get(`api/school/plan/history${query}`)
}

// 学校-就业质量报告
const schoolJoList = schoolId => {
  return get(`api/school/job/report/list?schoolId=${schoolId}`)
}
//科目列表
const subjectList = param => {
  return get(`api/subjects/list`, param);
}
// 通过科目选专业
const recommendList = param => {
  const query = contactUrlParams(param)
  return get(`api/specialty/recommend${query}`);
}
// 专业详情
// const recommendDetail = id => {
//   return get(`api/specialty/${id}`)
// }
// 专业详情-专业视频解读
const videoPage = param => {
  const query = contactUrlParams(param)
  return get(`api/specialty/video/page${query}`);
}
const recommendDetail = code => {
  return get(`api/specialty/info/${code}`)
}
//城市科目列表
const citySubjectList = code => {
  return get(`api/city/cityList/${code}`);
}
//专业列表
const majorList = param => {
  const query = contactUrlParams(param)
  return get(`api/specialty/list${query}`);
}

//专业分页列表
const majorPageList = param => {
  const query = contactUrlParams(param)
  return get(`api/specialty/page${query}`);
}
//前两级专业列表
const twoMajorList = param => {
  const query = contactUrlParams(param)
  return get(`api/specialty/twoList${query}`);
}
// 专业就业行业分布
const industrydistri = specialId => {
  return get(`api/specialty/job/industrydistribution/list?specialId=${specialId}`)
}
// 专业就业岗位分布
const postdistri = specialId => {
  return get(`api/specialty/job/postdistribution/list?specialId=${specialId}`)
}
// 专业就业地区分布
const regionadistri = specialId => {
  return get(`api/specialty/job/regionadistribution/list?specialId=${specialId}`)
}


const majorDetail = id => {
  return get(`api/specialty/info/${id}`)
}
//城市列表
const getCitiesList = param => {
  return get(`api/city/list`, param);

}
const mainViewPic = param => {
  return get(`api/mainViewPic`, param)
}
//批次查询
const batchList = pram => {
  const query = contactUrlParams(pram)
  return get(`api/batch/list${query}`)
}
// 批次获取年份对应类别
const batchCategory = provinceId => {
  return get(`api/batch/category/${provinceId}`)
}
//测评列表
const reviewList = pram => {
  return get(`api/review/list`)
}
//测评题目
const reviewInfo = id => {
  return get(`api/review/subject/${id}`)
}
//用户测评列表
const userReviewList = pram => {
  const query = contactUrlParams(pram)
  return get(`api/user/review${query}`)
}
//测评结果提交
const reviewOpen = (reviewId, pram,params) => {
  const query=contactUrlParams(params)
  return post(`api/user/review/${reviewId}/open${query}`, pram)
}
//测评详情
const reviewDetail=params=>{
  const query=contactUrlParams(params)
  return get(`api/user/review/yiqicheng/detail${query}`)
}
//意见反馈
const feedback = param => {
  return post(`api/advice`, param)
}
const schoolArticle = (id, param) => {
  const query = contactUrlParams(param)
  return get(`api/school/admissions/${id}${query}`)
}
const articleDetail = (id) => {
  return get(`api/school/admissions/info/${id}`)
}
const commentAdd = param => {
  const id = param.id
  return post(`api/bbs/${id}/leave-msg`, param)
}
// 一分一段
const cityScoreYear = cityCode => {
  return get(`api/city/score/${cityCode}`)
}
const history = param => {
  return get(`api/city/bypart/history/${param.cityCode}/${param.year}/${param.category}/${param.score}`)
}
// 类别筛选条件
const categorys = cityCode => {
  return get(`api/city/bypart/category/${cityCode}`)
}
// 批次筛选条件
const level = cityCode => {
  return get(`api/city/bypart/batch/${cityCode}`)
}
const cityScore = param => {
  const cityCode = param.code
  const year = param.year
  const category = param.category
  const level = param.level
  return get(`api/city/bypart/${cityCode}/${year}/${category}?level=${level}`)
}
//配置数据
const dictData = dictCode => {
  return get(`api/dict/${dictCode}`)
}
//智能推荐
const aiMatch = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/aiMatchTest${query}`)
}
//智能推荐 新
const newAiMatch = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/newAiMatch${query}`)
}
// 获取学校专业分数
const getSchoolSpecialtyPage = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/getSchoolSpecialtyPage${query}`)
}
//加入志愿
const addVoluntary = schoolSpecialtyId => {
  return post(`api/voluntary/add/${schoolSpecialtyId}`)
}
//收藏专业
const addSpecialty = code => {
  return post(`api/voluntary/add/specialty/${code}`)
}
// 收藏专业列表
const specialtyList = param => {
  const query = contactUrlParams(param)
  return get(`api/voluntary/specialty/list${query}`);
}
//志愿填报卡
const volunteerCard = param => {
  const query = contactUrlParams(param)
  return get(`api/school/volunteer${query}`)
}
//用户推广-分页列表查询
const shareList = param => {
  const query = contactUrlParams(param)
  return get(`api/user/promote/page${query}`);
}
const commentDelete = param => {
  const bbsId = param.id
  const msgId = param.msgId
  const pram = {
    msgId
  }
  const query = contactUrlParams(pram)
  return Delete(`api/bbs/${bbsId}/leave-msg/msgId${query}`)
}
// 开通会员
const pay = param => {
  return get(`api/pay/vip/pay`)
}
const payMember=params=>{
  return post(`api/pay/vip/pay/member`,params)
}
// 开通测试支付
const reviewPay = param => {
  return get(`api/pay/vip/pay/review`)
}
// 根据城市获取高中
const hignSchool = code => {
  return get(`api/user/hignSchool/list?cityCode=${code}`)
}
const virtualPay = username => {
  return post(`api/pay/vip/virtualPaying/${username}`)
}
//个人中心我的志愿表
const volunteerList = param => {
  const query = contactUrlParams(param)
  return get(`api/voluntary/list${query}`)
}

//新增共享
const addShare = phone => {
  return get(`api/user/promote/${phone}`)
}
//添加我的成绩
const addScore = param => {
  return post('api/user/schoolReport/add', param)
}
//我的成绩
const getScore = spreadUserId => {
  return get(`api/user/schoolReport/info?spreadUserId=`+spreadUserId)
}
// 志愿意向表-添加
const fillingAdd = param => {
  return post(`api/voluntary/filling/add`, param)
}
// 收藏学校
const schoolAdd = schoolId => {
  return post(`api/voluntary/add/school/${schoolId}`)
}
// 学校-录取概率
const enrollmentList = param => {
  const query = contactUrlParams(param)
  return get(`api/school/enrollmentList${query}`)
}
// 录取概率汇总
const voluntarySum = param => {
  const query = contactUrlParams(param)
  return get(`api/school/plan/voluntary/page/sum${query}`)
}
// 志愿意向表-编辑
const fillingEdit = param => {
  return Put(`api/voluntary/filling/edit`, param)
}
// 志愿意向表-获取
const fillingInfo = param => {
  return get(`api/voluntary/filling`)
}
const information = params => {
  return post(`api/consult`, params)
}

// 专业收藏
// const collectSchool= schoolId => {
//   return post(`api/voluntary/add/${schoolId}`)
// }

// 学校收藏列表
const schoolCollect = pram => {
  const query = contactUrlParams(pram)
  return get(`api/voluntary/school/list${query}`)
}
// 各省历史分数线
const scoreProvince = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/score/province/list${query}`)
}
// 专业分数线
const scoreSpecial = (pram,type) => {
  const query = contactUrlParams(pram)
  return get(`api/${type?type+'/':''}school/score/special/list${query}`)
}
// 往年专业分数线
const specialHistory = (pram) => {
  const query = contactUrlParams(pram)
  return get(`api/school/score/special/history${query}`)
}
// 毕业生就业单位
const employmentunit = schoolId => {
  return get(`api/school/job/employmentunit/list?schoolId=${schoolId}`)
}
// 毕业生就业单位性质
const employmentunittype = schoolId => {
  return get(`api/school/job/employmentunittype/list?schoolId=${schoolId}`)
}
// 毕业生签约地区流向
const signedplace = schoolId => {
  return get(`api/school/job/signedplace/list?schoolId=${schoolId}`)
}
// 开设专业
const openmajor = schoolId => {
  return get(`api/school/openmajor/list?schoolId=${schoolId}`)
}
// 历史分数线查询年份-类别
const provinceCategory = param => {
  const {
    provinceId,
    schoolId
  } = param
  return get(`api/school/score/province/category/${provinceId}/${schoolId}`)
}
// 专业分数线查询学科
const specialCategory = (param,type) => {
  const {
    provinceId,
    schoolId
  } = param
  return get(`api/${type?type+'/':''}school/score/special/category/${provinceId}/${schoolId}`)
}
// 专业分数线查询批次
const specialBatch = (param,type) => {
  const {
    provinceId,
    schoolId
  } = param
  return get(`api/${type?type+'/':''}school/score/special/batch/${provinceId}/${schoolId}`)
}
// 专业分数线查询 专业组
const specialSpcgroup = (param,types) => {
  const {
    provinceId,
    schoolId,
    type
  } = param
  return get(`api/${types?types+'/':''}school/score/special/spcgroup/${provinceId}/${schoolId}/${type}`)
}
// 专业详情-专业开设院校
const queryOpenMajorPage = pram => {
  const query = contactUrlParams(pram)
  return get(`api/specialty/queryOpenMajorPage${query}`)
}
// 专业详情-薪资列表
const salaryList = pram => {
  const query = contactUrlParams(pram)
  return get(`api/specialty/city/salary/list${query}`)
}
// 专业详情-薪资列表-毕业时间筛选条件
const salaryGraduation = specialId => {
  return get(`api/specialty/city/salary/graduation/${specialId}`)
}
// 专业详情-薪资列表-行业类型筛选条件
const salaryIndustry = specialId => {
  return get(`api/specialty/city/salary/industry/${specialId}`)
}
// 高考日程
const gaokaoTime = provinceId => {
  return get(`api/gaokao/time/${provinceId}`)
}
//院校排行
const schoolRankList = params => {
  const query = contactUrlParams(params)
  return get(`api/school/rank/list/${query}`)
}
//院校排行--查询条件分类
const schoolRankType = rankType => {
  return get(`api/school/rank/rankClass/${rankType}`)
} //院校排行--查询条件机构
const schoolRank = prams => {
  return get(`api/school/rank/rankType`)
}
// 学校对比-学校信息
const schoolContrast = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/contrast/list${query}`)
}
// 学校对比-招录信息
const enrollInfo = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/contrast/enrollInfo${query}`)
}
// 学校对比-选科信息
const specialInfo = pram => {
  const query = contactUrlParams(pram)
  return get(`api/school/contrast/specialInfo${query}`)
}
//分数相近院校推荐
const samescoreList = params => {
  const query = contactUrlParams(params)
  return get(`api/school/samescore/list${query}`)
}
//查询自主选科匹配度
const matchReport = params => {
  const query = contactUrlParams(params)
  return get(`api/school/plan/match/report${query}`, )
}
// 根据省份年份获取大数据
const matchBigdata = param => {
  const {
    provinceId,
    year
  } = param
  return get(`api/school/plan/match/bigdata/${provinceId}/${year}`)
}
//查询选科方案匹配的学校或专业
const matchSchool = params => {
  const query = contactUrlParams(params)
  return get(`api/school/plan/match/school${query}`)
}
const matchCustom = params => {
  const query = contactUrlParams(params)
  return get(`api/school/plan/match/custom${query}`)
}
const matchSpecial = params => {
  const query = contactUrlParams(params)
  return get(`api/school/plan/match/special${query}`)
}
// ai志愿--获取城市
const volunteerCity = params => {
  return get(`api/voluntary/config/city`)
}
// ai志愿--获取成绩类型
const volunteerCityType = provinceId => {
  return get(`api/voluntary/config/level1/${provinceId}`)
}

//首页查询list
const searchList = params => {
  const query = contactUrlParams(params)
  return get(`api/search/list${query}`)
}
//分数对应排名
const queryRank = params => {
  const query = contactUrlParams(params)
  return get(`api/user/schoolReport/queryRank${query}`)
}
const couponList = params => {
  const query = contactUrlParams(params)
  return get(`api/coupon/list${query}`)
}
const couponReceive = params => {
  return post(`api/coupon/receive`, params)
}
const couponReceiveList = params => {
  return get(`api/coupon/receiveList`)
}
//我的订单
const cardList = params => {
  const query = contactUrlParams(params)
  return get(`api/member/card/record/list${query}`)
}
//修改成绩
const cardScoreUpdate = params => {
  return post(`api/member/card/record/updateScore`, params)
}
//查询当前使用卡
const cardGetUse = params => {
  return get(`api/member/card/record/getUse`)
}
//设置当前使用卡
const cardUse = params => {
  return post(`api/member/card/record/use`, params)
}
//激活会员卡
const cardActivation = params => {
  return post(`api/member/card/updateScore`,params)
}
// 激活会员卡-new
const cardActive = params => {
  return post(`api/member/card/active`,params)
}
const articleList=params=>{
  const query=contactUrlParams(params)
  return get(`api/article/page${query}`)
}
const schoolReportAdd=params=>{
  return post(`api/school/plan/match/schoolReport/add`,params)
}
const schoolReportEdit=params=>{
  return Put(`api/school/plan/match/edit`,params)
}
const schoolReportList=params=>{
  const query=contactUrlParams(params)
  return get(`api/school/plan/match/page${query}`)
}
const getDictData=dictCode=>{
  return get(`api/dict/${dictCode}`)
}
const topicList=params=>{
  const query=contactUrlParams(params)
  return get(`api/zhenti/list${query}`)
}
// 获取真题城市
const zhentiCity=params=>{
  return get(`api/zhenti/city`,)
}
// 真题附件-列表查询
const attachment=params=>{
  return get(`api/zhenti/attachment/${params.pid}/${params.type}`,)
}

const couponUseList=price=>{
  return get(`api/coupon/useable?payPrice=${price}`,)
}

// 高考课程
const courseList=params=>{
  const query=contactUrlParams(params)
  return get(`api/course/page${query}`)
}
//课程详情
const courseDetail=params=>{
  return get(`api/course/${params.id}?itemid=${params.itemId}`)
}
// 课程目录
const courseItemList=params=>{
  const query=contactUrlParams(params)
  return get(`api/course/itemList${query}`)
}
//访问课程记录
const browseList=params=>{
  const query=contactUrlParams(params)
  return get(`api/course/browseList${query}`)
}
//收藏课程-添加/取消
const collectCourse=courseId=>{
  return post(`/api/course/collect/add/${courseId}`)
}
//vip价格列表
const vipPriceList=params=>{
  return get(`api/member/type/list`)
}
const coursePay=params=>{
  return post('api/pay/course/pay',params)
}
const volunteerPay=params=>{
  return post(`api/pay/volunteer/pay`,params)
}
const collectCoursePage=params=>{
  return get(`api/course/collect/page`,params)
}
//志愿指导订单
const volunteerOrderList=params=>{
  const query=contactUrlParams(params)
  return get(`api/volunteer/order/list${query}`)
}
//课程订单
const courseOrderList=params=>{
  const query=contactUrlParams(params)
  return get(`api/course/order/list${query}`)
}
// 获取活动链接价格
const memberCardPay=id=>{
  return get(`api/member/card/batch/${id}`)
}
// 链接开通会员
const discountPay=params=>{
  return post(`api/pay/vip/pay/discount`,params)
}
// 许愿墙分页
const bbsPage=params=>{
  return get(`api/bbs/page`,params)
}
// 许愿墙添加
const bbsAdd=params=>{
  return post(`api/bbs/add`,params)
}
// 许愿墙点赞
const bbsLike=params=>{
  return post(`api/bbs/${params.id}/like`)
}
// 许愿墙评论
const bbsLeave=params=>{
  return post(`api/bbs/${params.id}/leave-msg`,params)
}
// 许愿墙评论列表
const bbsLeavePage=params=>{
  return get(`api/bbs/${params.id}/leave-msg/page`,params)
}
// 许愿墙我的消息
const bbsMessagePage=params=>{
  return get(`api/bbs/message/page`,params)
}
// 许愿墙设置全部已读
const readAllMessage=params=>{
  return get(`api/bbs/message/readAllMessage`,params)
}

// 许愿墙删除
const bbsDelete=bbsId=>{
  return Delete(`api/bbs/${bbsId}`)
}
// 许愿墙消息未读数量
const messageNum=params=>{
  return post(`api/bbs/message/num`,params)
}

// 领取测评活动
const reviewReceive=params=>{
  return post(`api/review/receive`,params)
}
// 批次详情
const memberBatch=id=>{
  return get(`/api/member/card/batch/${id}`)
}
// 获取邀请进度
const progress=id=>{
  return get(`api/activity/invite/progress/${id}`)
}
// 获取邀请配置
const getInfo=params=>{
  return get(`api/activity/invite/getInfo`)
}
//活动价格-获取配置
const getActivityConfig=id=>{
  return get(`api/activity/price/getInfo/${id}`)
}
// 领取体验次数
const shareAdd=params=>{
  return get(`api/user/share/count/add`,params)
}
// 查看消耗次数
const shareDeduct=params=>{
  return get(`api/user/share/count/deduct`,params)
}
// 首页推荐学校
const schoolRecommend=params=>{
  return get(`api/user/school/recommend`,params)
}
// 扫码领取测评
const reviewScan=id=>{
  return post(`api/user/review/scan/${id}`)
}

module.exports = {
  volunteerOrderList,
  getActivityConfig,
  courseOrderList,
  topicList,
  collectCoursePage,
  volunteerPay,
  coursePay,
  vipPriceList,
  courseList,
  browseList,
  courseDetail,
  collectCourse,
  courseItemList,
  couponUseList,
  schoolReportList,
  getDictData,
  articleList,
  schoolReportAdd,
  schoolReportEdit,
  cardList,
  cardScoreUpdate,
  cardActivation,
  cardGetUse,
  cardUse,
  couponList,
  couponReceive,
  couponReceiveList,
  schoolRankList,
  queryRank,
  searchList,
  volunteerCity,
  volunteerCityType,
  matchSpecial,
  matchCustom,
  matchSchool,
  matchReport,
  samescoreList,
  schoolRankType,
  schoolRank,
  information,
  fillingAdd,
  fillingEdit,
  fillingInfo,
  schoolArticle,
  pay,
  payMember,
  schoolList,
  virtualPay,
  reviewPay,
  schoolDetail,
  articleDetail,
  twoMajorList,
  userReviewList,
  reviewOpen,
  subjectList,
  majorList,
  majorPageList,
  getCitiesList,
  mainViewPic,
  commentAdd,
  commentDelete,
  citySubjectList,
  batchList,
  reviewList,
  reviewInfo,
  cityScore,
  feedback,
  dictData,
  majorDetail,
  aiMatch,
  addVoluntary,
  volunteerCard,
  shareList,
  volunteerList,
  addShare,
  addScore,
  getScore,
  newAiMatch,
  // collectSchool,
  recommendList,
  recommendDetail,
  schoolCollect,
  schoolAdd,
  cityScoreYear,
  getSchoolSpecialtyPage,
  addSpecialty,
  specialtyList,
  scoreProvince,
  scoreSpecial,
  specialHistory,
  employmentunit,
  employmentunittype,
  signedplace,
  openmajor,
  provinceCategory,
  specialCategory,
  specialBatch,
  specialSpcgroup,
  queryOpenMajorPage,
  schoolNewsPage,
  categorys,
  level,
  industrydistri,
  postdistri,
  regionadistri,
  schoolBranch,
  schoolBranchDetail,
  planBatch,
  voluntaryTtem,
  planCategory,
  planSpcgroup,
  planPage,
  planHistory,
  schoolNews,
  hignSchool,
  salaryGraduation,
  salaryList,
  salaryIndustry,
  gaokaoTime,
  schoolContrast,
  enrollInfo,
  specialInfo,
  videoPage,
  matchBigdata,
  batchCategory,
  schoolJoList,
  cardActive,
  enrollmentList,
  zhentiCity,
  attachment,
  voluntarySum,
  memberCardPay,
  discountPay,
  bbsPage,
  bbsAdd,
  bbsLike,
  bbsLeave,
  bbsLeavePage,
  reviewReceive,
  memberBatch,
  bbsMessagePage,
  bbsDelete,
  messageNum,
  readAllMessage,
  progress,
  getInfo,
  shareAdd,
  shareDeduct,
  schoolRecommend,
  reviewScan,
  history,
  reviewDetail
}